<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>分类列表</title>
    <style>
        body {
            margin: 0;
            padding: 40px 20px;
            background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            color: #e0f7fa;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 100vh;
        }

        h1 {
            font-size: 2.5rem;
            color: #00f7ff;
            text-shadow: 0 0 10px #00f7ff;
            margin-bottom: 30px;
        }

        nav {
            margin-bottom: 20px;
        }

        nav a {
            color: #00e6e6;
            font-weight: bold;
            margin: 0 10px;
            text-decoration: none;
            font-size: 1.1rem;
            transition: color 0.3s;
        }

        nav a:hover {
            color: #ffffff;
            text-shadow: 0 0 8px #00f7ff;
        }

        a.button {
            background: linear-gradient(90deg, #00f7ff, #01c8ff);
            padding: 8px 16px;
            border-radius: 10px;
            color: #001f29;
            font-weight: bold;
            text-decoration: none;
            transition: transform 0.2s, box-shadow 0.3s;
        }

        a.button:hover {
            transform: scale(1.05);
            box-shadow: 0 0 10px #00f7ff;
        }

        table {
            width: 90%;
            max-width: 800px;
            border-collapse: collapse;
            background-color: rgba(20, 30, 40, 0.95);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
        }

        th, td {
            padding: 12px 16px;
            border-bottom: 1px solid #00cfd1;
            text-align: center;
        }

        th {
            background-color: #012b39;
            color: #00f7ff;
            text-shadow: 0 0 6px #00f7ff;
        }

        tr:hover {
            background-color: rgba(0, 255, 255, 0.05);
        }

        p {
            margin: 20px 0;
        }

        td a {
            color: #00e6ff;
            text-decoration: none;
            margin: 0 5px;
        }

        td a:hover {
            text-shadow: 0 0 6px #00f7ff;
        }
    </style>
</head>
<body>
    <h1>分类列表</h1>
    <nav>
        <a href="/">首页</a> |
        <a href="/categories">分类管理</a>
    </nav>
    <p><a class="button" href="/categories/add">添加新分类</a></p>
    <table>
        <tr><th>ID</th><th>名称</th><th>操作</th></tr>
        {{range .Categories}}
        <tr>
            <td>{{.ID}}</td>
            <td>{{.Name}}</td>
            <td>
                <a href="/categories/edit/{{.ID}}">编辑</a> |
                <a href="/categories/delete/{{.ID}}" onclick="return confirm('确定删除？')">删除</a>
            </td>
        </tr>
        {{else}}
        <tr><td colspan="3">暂无数据</td></tr>
        {{end}}
    </table>
</body>
</html>
